﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>

int finds(char* p1, char* p2)
{
	if (strlen(p1) != strlen(p2))
	{
		return 0;
	}
	char pp[256] = { 0 };
	strcpy(pp, p1);
	strcat(pp, p1);
	return strstr(pp, p2) != NULL;
}
int main()
{
	char a1[] = "abcdef";
	char a2[] = "cdefab";
	int ret = finds(a1, a2);
	if (ret == 1)
	{
		printf("旋转后相同");
	}
	else
	{
		printf("旋转后不相同");
	}
	return 0;
}